<template>
    <fieldset>
        <legend>展示模态框组件</legend>
        <Modal :visible="flag" @onOk="handleOk" @cancel="handleCancel">
            <template v-slot:title>
                <h1>充值提示12312</h1>
            </template>
            <template v-slot:body>
                <h3>您正在充值700000欢乐豆是否确定?</h3>
            </template>
        </Modal>
        <button @click="showModal">点击显示模态框</button>
    </fieldset>
</template>
<script>
    import Modal from "./Modal/index.vue";
    export default {
        components: { Modal },
        data() {
            return {
                flag: false
            }
        },
        methods: {
            showModal() {
                this.flag = true
            },
            handleOk() {
                this.flag = false
                console.log('确定了')
            },
            handleCancel() {
                this.flag = false
                console.log('取消了')
            }
        }
    }
</script>